﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace ST.Buz.Base.Entity
{
	/// <summary>
	/// 行比较
	/// </summary>
	public class Sys_Compare_RowID<T> : IEqualityComparer<T> where T : ISys_RowID
	{
		public bool Equals(T x, T y)
		{
			if (x == null && y == null)
			{
				return true;
			}
			else if (x == null || y == null)
			{
				return false;
			}
			else
			{
				return x.ID == y.ID;
			}
		}

		public int GetHashCode(T obj)
		{
			if (obj == null)
			{
				return 0;
			}
			return obj.ID.GetHashCode();
		}
	}
}
